﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SL8.SL.ViewModels
{
    public abstract class UIViewModelBase : ViewModelBase
    {
        private int _nWork = 0;
        public virtual bool IsBusy
        {
            get
            {
                return this._nWork != 0;
            }

            set
            {
                if (value)
                {
                    this._nWork++;
                }
                else
                {
                    this._nWork--;
                }

                this.RaisePropertyChanged(o => o.IsBusy);
            }
        }

        /// <summary>
        ///  初始化模型
        /// </summary>
        public virtual void InitializeViewModel()
        { }
    }
}
